﻿<phone:PhoneApplicationPage 
    x:Class="Microsoft.Samples.WindowsPhoneCloud.Phone.Pages.SampleDataDetailsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DataContext="{d:DesignData ../DesignData/SampleDataDetailsPageViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait" 
    shell:SystemTray.IsVisible="True" d:DesignHeight="696" d:DesignWidth="480">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{StaticResource ApplicationNameString}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="new row" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" TextWrapping="Wrap"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentGrid" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>     

            <ScrollViewer Grid.Row="0" Margin="12,0,12,0">
                <StackPanel>
                    <StackPanel Margin="0,0,0,10">
                        <TextBlock Text="Partition key" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5"/>
                        <TextBox x:Name="PartitionKeyTextBox" Text="{Binding Path=SampleData.PartitionKey, Mode=TwoWay}" KeyUp="OnTextBoxKeyUp" />
                    </StackPanel>

                    <StackPanel Margin="0,0,0,10">
                        <TextBlock Text="Row key" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5"/>
                        <TextBox x:Name="RowKeyTextBox" Text="{Binding Path=SampleData.RowKey, Mode=TwoWay}" KeyUp="OnTextBoxKeyUp"/>
                    </StackPanel>

                    <StackPanel Margin="0,0,0,10">
                        <TextBlock Text="Name" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5"/>
                        <TextBox x:Name="NameTextBox" Text="{Binding Path=SampleData.Name, Mode=TwoWay}" KeyUp="OnTextBoxKeyUp" />
                    </StackPanel>

                    <StackPanel Margin="0,0,0,10">
                        <TextBlock Text="Description" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5"/>
                        <TextBox x:Name="DescriptionTextBox" Text="{Binding Path=SampleData.Description, Mode=TwoWay}" KeyUp="OnTextBoxKeyUp" />
                    </StackPanel>

                    <StackPanel Margin="0,0,0,10">
                        <TextBlock Text="Number" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5"/>
                        <TextBox x:Name="NumberTextBox" InputScope="Number" Text="{Binding Path=SampleData.Number, Mode=TwoWay}" KeyUp="OnTextBoxKeyUp" />
                    </StackPanel>

                    <StackPanel Margin="0,0,0,10">
                        <TextBlock Text="Date" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5"/>
                        <toolkit:DatePicker x:Name="DateDatePicker" Value="{Binding Path=SampleData.Date, Mode=TwoWay}" />  
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>

            <StackPanel Grid.Row="1" Margin="12,0,12,0" Orientation="Vertical" VerticalAlignment="Bottom">
                <TextBlock Height="Auto" HorizontalAlignment="Left" Margin="15,2,0,0" Name="Message" Text="{Binding Message}" TextWrapping="Wrap" />
                <ProgressBar Height="20" IsIndeterminate="True" Visibility="{Binding IsSaving, Converter={StaticResource VisibilityConverter}}" />
            </StackPanel>
        </Grid>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/appbar.save.rest.png" Text="save" Click="OnSaveSampleData" />
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/appbar.delete.rest.png" Text="delete" Click="OnDeleteSampleData"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>